<form id="frm-step-3" name="frm-step-3" action="{{"widgets/ei"|base_url}}" method="POST" 
      onsubmit="return false;" 
      target="integration_asynchronous" autocomplete="off" 
      >
    <!--      title      -->
    <div class="p-r p-b-12">
        <p>Title</p>
        <div class="p-r">
            <input 
                type="text" onblur="AliasTo('#_title','#_alias')"
                class="w-320 b-g-c-i validate[required]" 
                value="{{$ocat->cat_title}}" 
                minlength="10"
                maxlength="120" 
                id="_title" name="_title"
                />
            <input 
                type="hidden" 
                value="{{$ocat->cat_title}}" 
                id="_titlec" name="_titlec"
                />
            <input 
                type="hidden" 
                value="{{$ocat->cat_id}}" 
                id="cat_id" name="cat_id"
                />
            <span class="p-a t-4 r-4 f-z-12 l-h-16 f-w-b c-s-p a t-d-n">×</span>
        </div>
    </div>
    <div class="clear"></div>
    <!--      alias      -->
    <div class="p-r p-b-12">
        <p><label class="d-p-b w-i" for="_alias">Alias</label></p>
        <div class="p-r">
            <input 
                type="text" 
                class="w-i b-g-c-i validate[required,custom[alias]]" 
                value="{{$ocat->cat_alias}}" 
                minlength="10"
                maxlength="120" 
                id="_alias" name="_alias"
                />
            <span 
                onclick=""
                class="p-a t-4 r-4 f-z-12 l-h-16 c-s-p a t-d-n">✖⊗×</span>
        </div>
    </div>
    <div class="clear"></div>
    <!--      parent      -->
    <div class="p-r p-b-12">
        <p>Parent</p>
        <div class="p-r w-320">
            {{function catitem level=0}}
            {{foreach $data as $cat}}
                {{if isset($ocat)}}
                    {{if $cat->cat_parent==$level and !$ocat->cat_id|in_array:$cat->parents and $ocat->cat_id!=$cat->cat_id}}
                        <option {{if $parent==$cat->cat_id}}selected="1"{{/if}} 
                            value="{{$cat->cat_id}}">
                            {{$cat->path}}
                        </option>
                        {{catitem data=$data level=$cat->cat_id parent=$ocat->cat_parent}}
                    {{else if $cat->cat_parent==$level and ( $ocat->cat_id|in_array:$cat->parents or $ocat->cat_id==$cat->cat_id )}}
                        <option disabled="disabled" value="{{$cat->cat_id}}">
                            {{$cat->path}}
                        </option>
                        {{catitem data=$data level=$cat->cat_id parent=$ocat->cat_parent}}
                    {{/if}}
                {{else}}
                    {{if $cat->cat_parent==$level}}
                        <option value="{{$cat->cat_id}}">
                            {{$cat->path}}
                        </option>
                        {{catitem data=$data level=$cat->cat_id parent=$ocat->cat_parent}}
                    {{/if}}
                {{/if}}
            {{/foreach}}
            {{/function}}
            <select id="_categories" class="w-320 p-a t-0 l-0" name="_categories">
                <option value="0">Danh mục gốc</option>
                {{catitem data=$category_model->HieCats level=0 parent=$ocat->cat_parent}}
            </select>
        </div>
        <p class="erc"></p>
    </div>
    <div class="clear"></div>
    <div class="p-r p-b-12 f-l">
        <div class="f-l" style="width: 79px">
            <!--      birth      -->
            <div class="p-r-2">
                <div class="p-r">
                    <p><label class="d-p-b w-i" for="_position">Position</label></p>
                    <input 
                        type="text" data-putto="#gr-err-1" 
                        class="w-i b-g-c-i validate[min[0],max[99]]" 
                        value="{{$ocat->cat_position}}" 
                        minlength="7" min="0" max="99"
                        maxlength="20" 
                        id="cat_position" name="cat_position"
                        />
                </div>
            </div>
        </div>
        <div class="f-l" style="width: 81px">
            <!--      birth      -->
            <div class="p-l-2 p-r-2">
                <div class="p-r">
                    <p><label class="d-p-b w-i" for="_status">Status</label></p>
                    <div class="p-r">
                        <select id="cat_status" name="cat_status" class="w-i">
                            <option value="true">Public</option>
                            <option value="false">Private</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="f-l" style="width: 160px">
            <!--      year      -->
            <div class="p-l-2">
                <div class="p-r">
                    <p><label class="d-p-b w-i" for="_type">Type</label></p>
                    <div class="p-r">
                        <select id="cat_type" name="cat_type" class="w-i">
                            <option value="Tin tức">Tin tức</option>
                            <option value="Sản phẩm">Sản phẩm</option>
                            <option value="Bài viết">Bài viết</option>
                            <option value="Khách hàng">Khách hàng</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <p id="gr-err-1" class="erb"></p>
    </div>
    <div class="clear"></div>
    <div class="p-r">
        <div id="step-3-back" onclick="CloseDialogMessage($('#reg-box-step-3'))" class="b-t-c g-d-w f-l m-r-8">Cancel</div>
        <div id="step-3-next" onclick="ucategory()" class="b-t-c g-d-w f-r">Save</div>
        <div class="clear"></div>
    </div>
    <span class="b-8 p-a l-50-pc w-80 reprefix-1 t-a-c">{{$ocat->cat_id}}/{{$category_model->HieCats|count}}</span>
</form>
<div class="clear"></div>